{extend name="common/common" /}

{block name="style"}
<link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
{/block}

{block name="content"}
<el-card class="box-card">
	<div slot="header">
		<span class="span-primary"><i class="fa fa-table"></i></span>
		企业日报表
	</div>
	<table  class="table table-bordered table-striped">
		<thead>
			<tr>
				<th colspan="7">
					<span class="span-primary">{$table.rpt_date|date="Y年m月d日",###}</span>
					<span class="span-warning">{$table.depart_name|default=""}</span>
					<span class="span-warning">-{$table.company_name|default=""}</span>
					企业日报表
				</th>
				<td colspan="3" class="text-right">
					填报人:<span class="span-primary">{$table.link_man}</span>
					联系方式:<span class="span-primary">{$table.link_type}</span>
				</td>
			</tr>
			<tr>
				<th class="text-center">序号</th>
				<th class="text-center">站点编码</th>
				<th class="text-center">站点名称</th>
				<th class="text-center">站点类型</th>
				<th class="text-center">代买商品类别</th>
				<th class="text-center">代买总金额（元）</th>
				<th class="text-center">代买总订单数（笔）</th>
				<th class="text-center">代卖商品类别</th>
				<th class="text-center">代卖总金额（元）</th>
				<th class="text-center">代卖总订单数（笔）</th>
			</tr>
		</thead>
		<tbody>
			{volist name="rows" id="row" key="k"}
			<tr class="text-center">
				<td>{$k}</td>
				<td>{$row.code|default=''}</td>
				<td>{$row.name|default=''}</td>
				<td>{$row.countyType_name|default=''}</td>
				<td>{$row.buy.commId_name|default=''}</td>
				<td>{$row.buy.money|default=''}</td>
				<td>{$row.buyOrder|default=''}</td>
				<td>{$row.sell.commId_name|default=''}</td>
				<td>{$row.sell.money|default=''}</td>
				<td>{$row.saleOrder|default=''}</td>
			</tr>
			{/volist}
		</tbody>
	</table>
	<p class="text-center">
		<el-button type="success" plain @click="subTable">提交表格</el-button>
		<el-button type="info" plain @click="history.back(-1)">返回列表</el-button>
	</p>
</el-card>
{/block}

{block name="script"}
<script type="text/javascript">
var main = new Vue({
	el:"#main",
	data:{
		loading:false,
	},
	methods:{
		subTable() {
			$.post('{:url("Commit/CommitDay")}',{
				table_id:"{$table.id}"
			},function(res) {
				if(res.code == 1){
					main.$notify({title:"成功",type:"success",message:res.msg});
				}else{
					main.$notify.error({title:"错误",message:res.msg});
				}
			});
		}
	}
})
</script>
{/block}
